package com.tool.payment.model;

import java.util.Date;
import java.util.HashMap;

/**
 * 支付参数
 * @author huff
 *
 */
public class PayParams extends HashMap<String, Object> {

	private static final long serialVersionUID = 1L;
	
	/**支付工具**/
	private static final String PRODUCT = "product";
	/**支付类型**/
	private static final String MODE = "mode";
	/**支付金额，单位分**/
	private static final String MONEY = "money";
	/**订单id**/
	private static final String WORKID = "workid";
	/**用户idid**/
	private static final String USERID = "userid";
	/**openid**/
	private static final String OPENID = "openid";
	/**回调前缀**/
	private static final String PREURL = "preurl";
	
	private static final String BILLDATE = "billDate";
	
	/**
	 * @param product
	 * @param workid
	 * @param userid
	 */
	public PayParams(String product,String mode) {
		this.put(PRODUCT, product);
		this.put(MODE, mode);
	}
	
	/**
	 * 微信下单
	 * @param product
	 * @param mode
	 * @param money
	 * @param workid
	 * @param userid
	 * @param openid
	 * @param preurl
	 */
	public PayParams(String product,String mode,Integer money,Object workid,Long userid,
							String openid,String preurl) {
		this(product, mode);
		this.put(MONEY, money);
		this.put(WORKID, workid);
		this.put(USERID, userid);
		this.put(OPENID, openid);
		this.put(PREURL, preurl);
	}
	
	/**
	 * 退款
	 * @param product
	 * @param workid
	 * @param userid
	 */
	public PayParams(String product,String mode,Object workid,Long userid) {
		this(product, mode);
		this.put(WORKID, workid);
		this.put(USERID, userid);
	}
	/**
	 * 对账单
	 * @param product
	 * @param mode
	 * @param billDate
	 */
	public PayParams(String product,String mode,Date billDate) {
		this(product, mode);
		this.put(BILLDATE, billDate);
	}
	
	public Long getUserid() {
		return (Long) this.get(USERID);
	}
	
	public String getPreurl() {
		return (String) this.get(PREURL);
	}
	
	public String getOpenid() {
		return (String) this.get(OPENID);
	}
	
	public Object getWorkid() {
		return this.get(WORKID);
	}
	
	public String getProduct() {
		return (String)this.get(PRODUCT);
	}
	
	public String getMode() {
		return (String) this.get(MODE);
	}
	
	public Integer getMoney() {
		return (Integer) this.get(MONEY);
	}
	
	public Date getBillDate() {
		return (Date) this.get(BILLDATE);
	}
}
